/*
	File:		BitmapFont.h
	Course:		SGD 1301
	Author:		dmonroe
	Purpose:	CBitmapFont class will draw text on the screen
				using a font image
*/

#pragma once


#include "../SGD Wrappers/SGD_String.h"

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>



////////////////////////////////////////////////////////////
// CBitmapFont class
//	- draws text to screen using a font image
//	- image file MUST have a size of a power of 2 (256 x 512, etc)
//	- font MUST be in ASCII order to calculate tile id
//	- uses the Cell Algorithm to convert the tile id to a source rect
class CBitmapFont
{
public:
	////////////////////////////////////////////////////////
	// NOT a singleton, so other fonts can be made
	CBitmapFont( void );
	~CBitmapFont( void );
	

	////////////////////////////////////////////////////////
	void	Initialize	( void );		// should have parameters
	void	Shutdown	( void );

	void	Draw		( const TCHAR* strOutput,
						  int nX,		int nY,
						  float fScale,	DWORD dwColor );
private:
	////////////////////////////////////////////////////////
	// cell algorithm
	RECT	CellAlgorithm( int nTileID ) const;

	int		m_nCellWidth;
	int		m_nCellHeight;
	int		m_nNumRows;
	int		m_nNumCols;
	
	////////////////////////////////////////////////////////
	// image
	int		m_nImageID;
	
	////////////////////////////////////////////////////////
	// font attributes
	TCHAR	m_cFirstChar;
	bool	m_bOnlyUpper;
};

